public abstract class BilateralAgent extends Agent implements BidHistoryKeeper
| Modifier and Type | Field and Description |
|---|---|
protected Domain |
domain |
protected BidHistory |
myHistory |
protected BidHistory |
opponentHistory |
fNegotiation, parametervalues, sessionNr, sessionsTotal, startTime, strategyParameters, timeline, totalTime, utilitySpace| Constructor and Description |
|---|
BilateralAgent() |
| Modifier and Type | Method and Description |
|---|---|
Action |
chooseAction()
this function is called after ReceiveMessage,
with an Offer-action.
|
abstract Bid |
chooseCounterBid()
The opponent has already made a bid.
|
abstract Bid |
chooseFirstCounterBid()
Use this method to make the first counter-bid.
|
abstract Bid |
chooseOpeningBid()
Use this method to make an opening bid.
|
Bid |
getMyLastBid() |
Bid |
getMySecondLastBid() |
BidHistory |
getOpponentHistory() |
Bid |
getOpponentLastBid() |
int |
getRound()
Returns the current round number, starting at 0.
|
protected double |
getUndiscountedUtility(Bid bid) |
static java.lang.String |
getVersion() |
void |
init()
This method is called by the protocol every time before starting a new
session after the internalInit method is called.
|
abstract boolean |
isAcceptable(Bid plannedBid)
At some point, one of the parties has to accept an offer to end the negotiation.
|
protected static void |
log(java.lang.String s) |
protected Action |
makeAcceptAction()
By default, if an offer is deemed acceptable, we send accept.
|
void |
ReceiveMessage(Action opponentAction)
informs you which action the opponent did
|
static double |
round2(double x)
Rounds to two decimals
|
endSession, getAgentID, getName, getParameterValues, getSessionNumber, getSessionsTotal, getStrategyParameters, getUtility, internalInit, isUIAgent, loadSessionData, parseStrategyParameters, restartDataObjectsFolder, saveSessionData, setAgentID, setName, sleepprotected Domain domain
protected BidHistory myHistory
protected BidHistory opponentHistory
public void init()
Agentpublic static java.lang.String getVersion()
public void ReceiveMessage(Action opponentAction)
AgentReceiveMessage in class Agentprotected double getUndiscountedUtility(Bid bid)
public Action chooseAction()
AgentchooseAction in class Agentremember: - remember the action or not.protected Action makeAcceptAction()
public abstract boolean isAcceptable(Bid plannedBid)
plannedBid - public abstract Bid chooseCounterBid()
public abstract Bid chooseOpeningBid()
public abstract Bid chooseFirstCounterBid()
public Bid getMyLastBid()
getMyLastBid in interface BidHistoryKeeperpublic Bid getMySecondLastBid()
getMySecondLastBid in interface BidHistoryKeeperpublic BidHistory getOpponentHistory()
getOpponentHistory in interface BidHistoryKeeperpublic Bid getOpponentLastBid()
getOpponentLastBid in interface BidHistoryKeeperpublic int getRound()
protected static void log(java.lang.String s)
public static double round2(double x)